package com.gzt.bookcatalog.event.listener;

import com.gzt.bookcatalog.event.BookEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class BookUpdateListener implements ApplicationListener<BookEvent> {

    @Override
    public void onApplicationEvent(BookEvent event) {
        // 处理书籍更新事件，例如日志记录、缓存更新等
        System.out.println("Book updated: " + event.getBook().getTitle());
    }
}
